package com.haizhi.workstation.result;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * 用来存放各种异常信息的类
 */
@Getter
@Setter
public class CodeMsg implements Serializable{


    private int code;//自定义的后台处理的响应码
    private String msg;//后台响应的信息
    //private T data;
    private CodeMsg(int code, String msg){
        this.code = code;
        this.msg = msg;
    }
    /*public CodeMsg fillArgs(Object... args) {
        CodeMsg codeMsg = new CodeMsg(this.getCode(),this.getMsg());
        codeMsg.setMsg(String.format(codeMsg.getMsg(),args));
        return codeMsg;
    }*/
    //系统异常信息500xx开头
    public static final CodeMsg SYSTEM_BUSY=new CodeMsg(50001,"系统繁忙,请稍后再试");
    public static final CodeMsg ERR_FOLDER =new CodeMsg(50002,"文件错误");

    //用户操作异常信息501xx开头
    public static final CodeMsg ACCESS_LIMIT=new CodeMsg(50101,"操作过于频繁,请稍后再试");
    public static final CodeMsg ERR_OPERATION=new CodeMsg(50102,"错误操作");
    public static final CodeMsg UNAUTHORIZED=new CodeMsg(50103,"未授权");
    public static final CodeMsg REPEAT_APPLY=new CodeMsg(50104,"请勿重复申请");
    public static final CodeMsg ERR_APPID=new CodeMsg(50105,"请使用正确的appId");
    public static final CodeMsg NONE_UNAUDIT_APPID=new CodeMsg(50106,"没有未审核的appId");
    //public static final CodeMsg LIMIT_ACCESS=new CodeMsg(50105,"访问被限制");
}
